/*
{
  "user_id": 1,
  "user_name": "hello",
  "created_at": "rq",
  "last_login": "rq",
  "avatar": "rq",
  "role": "rq",
  "access_token": "rq",
  "refresh_token": "rq",
  "expire_at": "rq",
  "repo": 1
}
 */

class UserLoginResponse {
  String accessToken;
  String avatar;
  String createdAt;
  String expireAt;
  String lastLogin;
  String refreshToken;
  int repo;
  String role;
  int userId;
  String userName;

  UserLoginResponse({this.accessToken, this.avatar, this.createdAt, this.expireAt, this.lastLogin, this.refreshToken, this.repo, this.role, this.userId, this.userName});

  factory UserLoginResponse.fromJson(Map<String, dynamic> json) {
    return UserLoginResponse(
      accessToken: json['access_token'],
      avatar: json['avatar'],
      createdAt: json['created_at'],
      expireAt: json['expire_at'],
      lastLogin: json['last_login'],
      refreshToken: json['refresh_token'],
      repo: json['repo'],
      role: json['role'],
      userId: json['user_id'],
      userName: json['user_name'],
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['access_token'] = this.accessToken;
    data['avatar'] = this.avatar;
    data['created_at'] = this.createdAt;
    data['expire_at'] = this.expireAt;
    data['last_login'] = this.lastLogin;
    data['refresh_token'] = this.refreshToken;
    data['repo'] = this.repo;
    data['role'] = this.role;
    data['user_id'] = this.userId;
    data['user_name'] = this.userName;
    return data;
  }
}
